#include "form1.h"
#include "ui_form1.h"
#include "widgetmanager.h"
#include <QPushButton>
#include <QDebug>

Form1::Form1(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form1)
{
    ui->setupUi(this);

    connect(ui->mainWinShow,&QPushButton::clicked,[=]{
        if(WidgetManager::getWidgetManager()->getWidget("mainWin")==nullptr){
            qDebug()<<"指针为空";
        }else {
            WidgetManager::getWidgetManager()->getWidget("mainWin")->show();
        }

    });

    connect(ui->mainWinHide,&QPushButton::clicked,[=]{
        if(WidgetManager::getWidgetManager()->getWidget("mainWin")==nullptr){
            qDebug()<<"指针为空";
        }else {
            WidgetManager::getWidgetManager()->getWidget("mainWin")->hide();
        }

    });
}

Form1::~Form1()
{
    delete ui;
}
